package project.menu.ordermenu.markerorder;

import api.controller.IAutoservice;
import project.controllers.Controller;
import project.controllers.Messager;
import project.controllers.Printer;
import project.menu.IMenu;
import project.menu.IMenuItem;
import project.work.Navigator;

public class OrderDeletedStatus implements IMenuItem {

	private String name = "Mark order deleted";
	private final Integer id = 1;
	private static IMenu submenu;
	private Controller controller;
	private Navigator navigator;

	public OrderDeletedStatus() {
		controller = Controller.getInstance();
		navigator = Navigator.getInstance();

	}

	public Integer getId() {
		return id;
	}

	public String getNameItem() {
		return name;
	}

	public static void setMenu(IMenu menu) {
		submenu = menu;
	}

	public void action(IAutoservice autoservice) {
		// mark

		autoservice.markOrderDeleted(controller.getNumberOrder());
		Printer.printMessage(Messager.ORDER_STATUS_CHANGE);

		navigator.drawMenu(submenu);

	}

}
